package com.web.quartz;

import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;

/**
 * @author: bi
 * @date: 2022/4/21 14:25
 */
@Slf4j
@DisallowConcurrentExecution
public class SyncJob implements Job {

    private ScheduleJob job;

    @Override
    public void execute(JobExecutionContext jobExecutionContext) {
        if (job == null)
            job = (ScheduleJob) jobExecutionContext.getMergedJobDataMap().get(QuartzConstants.JOB_KEY);
        job.execute();
    }
}
